#include "fig_boss_gyver.h"
#include "fighter.h"
#include "fig_bullet.h"
#include "fig_enemybullet_master.h"
#include "fig_player_craft.h"
#include "fig_sounds.h"
#include "fig_boss_attackmove_manager.h"

#include "num/rand.h"
#include "math/facing.h"
#include "dd/dd_man.h"

FIGBossGyver::FIGBossGyver(FIGEnemyCraft::ENEMY_TYPES EnemyType) : 
								FIGEnemyBoss(											
											EnemyType
											)
								
{
	m_ShootCounter.SetLimit(4.0f);	
	m_SecondaryWeaponCounter.SetLimit(1.5f);
}


void			FIGBossGyver::OnShootStyle1()
{
	
	for(int i = 0; i < 30; i++)
	{
		FIGEnemyBulletMaster::Instance().Shoot(
											this,
											m_Bone.GetPosByWayPoint(0),
											FIGEnemyBulletMaster::BULLET_TYPE_LONG_CYAN,
											FIGBullet::SHOOT_STYLES_SINGLE,
											0,		// degree
											i * 0.1f,
											true,
											NULL,
											false,
											FIGSounds::BOSS_SHOOT
          									);	

		
		FIGEnemyBulletMaster::Instance().Shoot(
											this,
											m_Bone.GetPosByWayPoint(1),
											FIGEnemyBulletMaster::BULLET_TYPE_LONG_CYAN,
											FIGBullet::SHOOT_STYLES_SINGLE,
											0,		// degree
											i * 0.1f,
											true,
											NULL,
											false,
											FIGSounds::BOSS_SHOOT
          									);	

	}
}

void			FIGBossGyver::OnShootStyle2()
{
	if(num::RAND32::Instance().RandInt(0,3) == 0)	
			FIGBossAttackMoveManager::Instance().Start(
									FIGBossAttackMoveManager::ATTACK_MOVEMENT_CIRCLE, 
									0.0f);

	for(int i = 0; i < 30; i++)
	{
		FIGEnemyBulletMaster::Instance().Shoot(
											this,
											m_Bone.GetPosByWayPoint(0),
											FIGEnemyBulletMaster::BULLET_TYPE_LONG_CYAN,
											FIGBullet::SHOOT_STYLES_SINGLE,
											180.0f,		// degree
											i * 0.1f,
											false,
											NULL,
											false,
											FIGSounds::BOSS_SHOOT
          									);	

		
		FIGEnemyBulletMaster::Instance().Shoot(
											this,
											m_Bone.GetPosByWayPoint(1),
											FIGEnemyBulletMaster::BULLET_TYPE_LONG_CYAN,
											FIGBullet::SHOOT_STYLES_SINGLE,
											180.0f,		// degree
											i * 0.1f,
											false,
											NULL,
											false,
											FIGSounds::BOSS_SHOOT
          									);	

		FIGEnemyBulletMaster::Instance().Shoot(
											this,
											m_Bone.GetPosByWayPoint(2),
											FIGEnemyBulletMaster::BULLET_TYPE_LONG_GREEN,
											FIGBullet::SHOOT_STYLES_SINGLE,
											45.0f + 180.0f,		// degree
											i * 0.1f,
											false,
											NULL,
											false,
											FIGSounds::BOSS_SHOOT
          									);	

		
		FIGEnemyBulletMaster::Instance().Shoot(
											this,
											m_Bone.GetPosByWayPoint(3),
											FIGEnemyBulletMaster::BULLET_TYPE_LONG_GREEN,
											FIGBullet::SHOOT_STYLES_SINGLE,
											-45.0f + 180.0f,		// degree
											i * 0.1f,
											false,
											NULL,
											false,
											FIGSounds::BOSS_SHOOT
          									);	
	}
}

void			FIGBossGyver::OnShootStyle3()
{
	
	for(int i = 0; i < 30; i++)
	{
		for(int j = 0; j < 4; j++)
		{
			if( j % 2 == 0)
				FIGEnemyBulletMaster::Instance().Shoot(
											this,
											m_Bone.GetPosByWayPoint(0),
											FIGEnemyBulletMaster::BULLET_TYPE_CIRCLE_TRIPPLELAYER,
											FIGBullet::SHOOT_STYLES_SINGLE,
											(float)(12 * i),		// degree
											j * 1.0f,
											false,
											NULL,
											false,
											FIGSounds::BOSS_SHOOT
          									);

			if( j % 2 == 1)
				FIGEnemyBulletMaster::Instance().Shoot(
											this,
											m_Bone.GetPosByWayPoint(1),
											FIGEnemyBulletMaster::BULLET_TYPE_CIRCLE_TRIPPLELAYER,
											FIGBullet::SHOOT_STYLES_SINGLE,
											(float)(12 * i),		// degree
											j * 1.0f,
											false,
											NULL,
											false,
											FIGSounds::BOSS_SHOOT
          									);
		}
	}
}
	
void			FIGBossGyver::OnShootStyle4()
{
	if(num::RAND32::Instance().RandInt(0,3) == 0)	
			FIGBossAttackMoveManager::Instance().Start(
									FIGBossAttackMoveManager::ATTACK_MOVEMENT_CIRCLE, 
									0.0f);

	for(int i = 0; i < 30; i++)
	{
		FIGEnemyBulletMaster::Instance().Shoot(
											this,
											m_Bone.GetPosByWayPoint(0),
											FIGEnemyBulletMaster::BULLET_TYPE_LONG_CYAN,
											FIGBullet::SHOOT_STYLES_SINGLE,
											45.0f + 180.0f,		// degree
											i * 0.1f,
											false,
											NULL,
											false,
											FIGSounds::BOSS_SHOOT
          									);	

		
		FIGEnemyBulletMaster::Instance().Shoot(
											this,
											m_Bone.GetPosByWayPoint(1),
											FIGEnemyBulletMaster::BULLET_TYPE_LONG_CYAN,
											FIGBullet::SHOOT_STYLES_SINGLE,
											-45.0f + 180.0f,		// degree
											i * 0.1f,
											false,
											NULL,
											false,
											FIGSounds::BOSS_SHOOT
          									);	

		FIGEnemyBulletMaster::Instance().Shoot(
											this,
											m_Bone.GetPosByWayPoint(2),
											FIGEnemyBulletMaster::BULLET_TYPE_LONG_GREEN,
											FIGBullet::SHOOT_STYLES_SINGLE,
											180.0f,		// degree
											i * 0.1f,
											false,
											NULL,
											false,
											FIGSounds::BOSS_SHOOT
          									);	

		
		FIGEnemyBulletMaster::Instance().Shoot(
											this,
											m_Bone.GetPosByWayPoint(3),
											FIGEnemyBulletMaster::BULLET_TYPE_LONG_GREEN,
											FIGBullet::SHOOT_STYLES_SINGLE,
											180.0f,		// degree
											i * 0.1f,
											false,
											NULL,
											false,
											FIGSounds::BOSS_SHOOT
          									);	
	}
}

void			FIGBossGyver::OnSecondaryWeaponShoot()
{
	for(int i = 4; i < 8; i++)
	{
		FIGEnemyBulletMaster::Instance().Shoot(
											this,
											m_Bone.GetPosByWayPoint(i),
											FIGEnemyBulletMaster::BULLET_TYPE_LONG_RED,
											FIGBullet::SHOOT_STYLES_SINGLE,
											180.0f,		// degree
											0,
											false,
											NULL,
											false,
											FIGSounds::BOSS_SHOOT
          									);	
	}

}









	